package com.baosight.sczx.zm.ci.service;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.dao.Dao;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.zm.ci.domain.ZMCIPersonInfo;

public class ServiceZMCI11 extends ServiceEPBase {
	@Override
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");// 如果不加这个，翻页的统计和显示是错误的
		inInfo=this.query(inInfo);
		return inInfo;
	}
	
	public EiInfo query(EiInfo inInfo) {
		StaticTools.setQueryParameters(inInfo, "fdMiningId", UserSession.getInSessionProperty("miningCode").toString(), true);
		inInfo=super.query(inInfo, "ZMCIPersonInfo.queryCount", getMetadata());
		return inInfo;
	}
	
	private EiBlockMeta getMetadata()
	{
		EiBlockMeta eiMetadata = new EiBlockMeta();
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdMiningName");
		eiColumn.setFieldLength(64);	
		eiColumn.setDescName("矿井名称");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdDepartment");
		eiColumn.setFieldLength(200);	
		eiColumn.setDescName("部门名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdLocationPlace");
		eiColumn.setFieldLength(50);	
		eiColumn.setDescName("所在位置");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("localNum");
		eiColumn.setFieldLength(64);	
		eiColumn.setDescName("人次");
		eiMetadata.addMeta(eiColumn);

		return eiMetadata;
	}
}
